package com.ruoyi.help.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.help.mapper.HelpFirefighterMapper;
import com.ruoyi.help.domain.HelpFirefighter;
import com.ruoyi.help.service.IHelpFirefighterService;

/**
 * 消防员Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-13
 */
@Service
public class HelpFirefighterServiceImpl implements IHelpFirefighterService 
{
    @Autowired
    private HelpFirefighterMapper helpFirefighterMapper;

    /**
     * 查询消防员
     * 
     * @param uId 消防员主键
     * @return 消防员
     */
    @Override
    public HelpFirefighter selectHelpFirefighterByUId(Long uId)
    {
        return helpFirefighterMapper.selectHelpFirefighterByUId(uId);
    }

    /**
     * 查询消防员列表
     * 
     * @param helpFirefighter 消防员
     * @return 消防员
     */
    @Override
    public List<HelpFirefighter> selectHelpFirefighterList(HelpFirefighter helpFirefighter)
    {
        return helpFirefighterMapper.selectHelpFirefighterList(helpFirefighter);
    }

    /**
     * 新增消防员
     * 
     * @param helpFirefighter 消防员
     * @return 结果
     */
    @Override
    public int insertHelpFirefighter(HelpFirefighter helpFirefighter)
    {
        helpFirefighter.setCreateTime(DateUtils.getNowDate());
        return helpFirefighterMapper.insertHelpFirefighter(helpFirefighter);
    }

    /**
     * 修改消防员
     * 
     * @param helpFirefighter 消防员
     * @return 结果
     */
    @Override
    public int updateHelpFirefighter(HelpFirefighter helpFirefighter)
    {
        helpFirefighter.setUpdateTime(DateUtils.getNowDate());
        return helpFirefighterMapper.updateHelpFirefighter(helpFirefighter);
    }

    /**
     * 批量删除消防员
     * 
     * @param uIds 需要删除的消防员主键
     * @return 结果
     */
    @Override
    public int deleteHelpFirefighterByUIds(Long[] uIds)
    {
        return helpFirefighterMapper.deleteHelpFirefighterByUIds(uIds);
    }

    /**
     * 删除消防员信息
     * 
     * @param uId 消防员主键
     * @return 结果
     */
    @Override
    public int deleteHelpFirefighterByUId(Long uId)
    {
        return helpFirefighterMapper.deleteHelpFirefighterByUId(uId);
    }
}
